<script>
export default {
  name: "headerCom"
}
</script>

<template>
<div>
<!--  首页有背景颜色头部-->
  <div class="blueHeader">
    <div>
      <div class="Logo">
        <img src="../assets/whiteLogo.png" alt="" />
      </div>
      <div class="nav">
        <ul>
          <li>首页</li>
          <li class="hideParent">
            <div>课程分类<a-icon type="down" /></div>
            <!-- 课程分类 -->
            <div class="hccDiv hideChildren">
              <ul class="hccUl">
                <li>宇哥带你学Java</li>
              </ul>
            </div>
          </li>
          <!-- 课程分类结束 -->
          <li>教学管理云平台</li>
        </ul>
        <div class="right">
          <a-input-search placeholder="input search text" enter-button @search="onSearch" />
          <a-button type="primary" shape="circle" icon="shopping-cart" />
          <p class="headerRegister">登录/注册</p>
        </div>
      </div>
    </div>
  </div>
<!--  通用头部-->
  <div class="whiteHeader">
    <div>
      <div>
        <div class="logo"><img src="../assets/greenLogo.png" alt="" /></div>
        <ul>
          <li>首页</li>
          <li class="hideParent">
            <div>课程分类<a-icon type="down" /></div>
            <!-- 课程分类 -->
            <div class="tsnDiv hideChildren">
              <ul>
                <li>宇哥带你学Java</li>
              </ul>
            </div>
          </li>
          <!-- 课程分类结束 -->
          <li>教学管理云平台</li>
        </ul>
      </div>
      <div class="right">
        <a-input-search placeholder="input search text" enter-button @search="onSearch" />
        <a-button type="primary" shape="circle" icon="shopping-cart" />
        <p class="register">登录/注册</p>
      </div>
    </div>
  </div>
</div>
</template>

<style scoped lang="less">
.blueHeader {
  background-image: url(../assets/topbg.png);
  background-repeat: no-repeat;
  background-size: cover;
  height: 295px;
  width: 100%;
  >div{
    width: 1160px;
    margin: 0 auto;
    .Logo{
      display: flex;
      img {
        width: 212px;
        margin: 50px auto;
      }
    }
    .nav {
      justify-content: space-between;
      display: flex;
      ul {
        list-style: none;
        display: flex;
        margin-left: 40px;
        position: relative;
        >li {
          color: #fff;
          margin-right: 30px;
          line-height: 38px;
          font-weight: 900;
          &:hover {
            cursor: pointer;
          }
          .hccDiv {
            display: none;
            ul {
              position: absolute;
              top: 32px;
              left: 61px;
              background-color: #fff;
              width: 136px;
              padding: 4px 0;
              border-radius: 2px;
              li {
                padding: 5px 12px;
                color: rgba(0, 0, 0, .65);
                line-height: 31px;
                font-weight: 400;
              }
            }
          }
        }
      }
      .right {
        display: flex;
        position: relative;

        .headerRegister {
          border-radius: 15px;
          background-color: #fff;
          width: 94px;
          height: 30px;
          font-weight: 900;
          color: rgb(53, 199, 222);
          line-height: 30px;
          text-align: center;
          cursor: pointer;
        }
      }
    }
  }
  /deep/ .ant-input-search-button {
    background-color: #3EB4DD;
  }
}
/deep/ .ant-input{
  border-top-left-radius: 25px;
  border-bottom-left-radius: 25px;
}
/deep/ .ant-input-search-button{
  border-top-right-radius: 25px;
  border-bottom-right-radius: 25px;
  border-color: #d9d9d9;
}
/deep/.ant-input-group-addon{
  border-top-right-radius: 25px;
  border-bottom-right-radius: 25px;
}
/deep/.ant-btn-circle{
  background-color: #00B278;
  border-color: transparent;
  margin: 0 10px;
}
.whiteHeader {
  /deep/ .ant-input-search-button {
    background-color: #00B278;
  }
  width: 100%;
  height: 80px;
  background-color: #fff;
  position: fixed;
  top: 0;
  left: 0;
  display: none;
  z-index: 50;
  >div{
    width: 1160px;
    margin: 0 auto;
    display: flex;
    height: 80px;
    align-items: center;
    justify-content: space-between;
    >div{
      display: flex;
      .logo,
      .logo img{
        width: 132px;
        height: 40px;
      }
      ul{
        list-style: none;
        margin-left: 40px;
        position: relative;
        display: flex;
        >li {
          margin-right: 30px;
          line-height: 38px;
          font-weight: 900;
          .tsnDiv {
            display: none;
            ul {
              position: absolute;
              top: 32px;
              left: 61px;
              background-color: #fff;
              width: 136px;
              padding: 4px 0;
              border-radius: 2px;
              box-shadow: 0 2px 4px 0 rgba(0, 0, 0, .23);
              >li {
                padding: 5px 12px;
                color: rgba(0, 0, 0, .65);
                line-height: 31px;
                font-weight: 400;
                &:hover {
                  cursor: pointer;
                }
              }
            }
          }
        }
      }
    }
    .right {
      display: flex;
      .register {
        border-radius: 15px;
        background-color: #fff;
        width: 94px;
        height: 30px;
        font-weight: 900;
        line-height: 30px;
        text-align: center;
        box-shadow: 0 2px 4px 0 rgba(0, 0, 0, .23);
        &:hover{
          cursor: pointer;
        }
      }
    }
  }
}

</style>